//
//  IMCore.h
//  IMChezhil
//
//  Created by zhangliucheng on 15/7/1.
//  Copyright (c) 2015年 CheZhil. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "IMLoginMessage.h"
#import "IMDelegate.h"
#import "IMTextMessage.h"
#import "IMImageMessage.h"
#import "IMAudioMessage.h"

@interface IMCore : NSObject

@property (assign, nonatomic) BOOL messageNotification;
@property (strong, nonatomic) IMLoginMessage *loginMessage;

+ (instancetype)shareInstance;

/**
 *  和Server验证信息.
 *
 *  @param uin   用户唯一ID
 *  @param token 用于校验用户的合法性
 *  @param cId   手机唯一表示符
 *  @param cType 手机类型 1表示ios，2表示Android
 */
- (void)loginWithUin:(NSString *)uin token:(NSString *)token clientId:(NSString *)cId;
- (void)logout;
- (NSString *)getUin;
- (BOOL)haveLogined;

/**
 *  获取未读消息的数量.
 */
- (NSInteger)getMessageUnReadCount;

/**
 *  获取最近本地聊天记录.
 *
 *  @param count
 */
- (NSMutableArray *)getRecentLocalMessages:(NSInteger)count;
//- (NSMutableArray *)getRecentMessages;

/**
 *  设置异地登陆和消息接受推送.
 */
- (void)registerNotificationReceiveDelegate:(id<IMNotificationReceiverDelegate>) receiveDelegate;

/**
 *  注册消息发送和接收的通知.
 */
- (void)registerMessageDelegate:(id<IMMessageReceiverDelegate>)messageDelegate;
/**
 *  移除消息发送和接收的通知.
 */
- (void)removeMessageDelegate;

// 获取需要发送的消息
- (IMMessage *)getSendMessage;
// 发送验证登陆信息
- (void)sendInitMessage;
- (IMTextMessage *)sendTextMessage:(NSString *)text;
- (IMImageMessage *)sendImageMessage:(NSString *)imagePath;
- (IMAudioMessage *)sendAudioMessage:(NSString *)audioPath;

@end